#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<string>
using namespace std;


int main() {
    int n, k;
    cin >> n >> k;
    int arr[5] = { 2,2,2,2,11 };
    int arrmax = 2;
    //for (int i = 0; i < n; i++)
    //{
    //    cin >> arr[i];
    //}
    for (int i = 0; i < k; i++)
    {
        for (int k = 0; k < n; k++)
        {
            if ((arr[k] % 2 == 0 && arr[k] > arrmax))
            {
                arrmax = arr[k];
            }
        }
        for (int j = 0; j < n; j++)
        {
            if (arr[j] == arrmax)
            {
                arr[j] /= 2;
                arrmax = 2;
                break;
            }
        }
    }
    int ret = 0;
    for (int i = 0; i < n; i++)
    {
        ret += arr[i];
    }
    cout << ret;
}